package com.woniu.commons.util;

import org.springframework.stereotype.Component;

@Component
public class RedisKey {
    public static String SITE_ALL_KEY(){
        return "site:all:";
    };
    public static String ORDERNUM_ADMIN_KEY(String orderNum){
        return "order:orderNum:"+orderNum;
    }
    public static String SITA_LIST(String orderNum){
        return "sita:list:"+orderNum;
    }

    public static String ADMIN_REFRESH_TOKEN_KEY(String access){
        return "admin:refresh:access:" + access;
    };
    public static String ADMIN_ACCESS_TOKEN_KEY(Integer Id) {
        return "admin:access:id" + Id;
    }
    public static String ACCESS_TIME_OUT(String accessToken) {
        return "access:timeout:" + accessToken;
    }
    public static String REGISTER_LAST_SEND_KEY(String phone){
        return "register:last:send:" + phone;
    };
    public static String PHONE_KEY(String phone){
        return "register:phone:" + phone;
    };
    public static String USER_REFRESH_TOKEN_KEY(String access){
        return "user:refresh:access:" + access;
    };
    public static String USER_ACCESS_TOKEN_KEY(String Id){
        return "user:access:id" + Id;
    };
    public static String SEND_REGISTER_CODE_KEY(String phone){
        return "register:phone:" + phone;
    };
    public static String REGISTER_LAST_SEND_TIME_KEY(String phone){
        return "register:last:sendtime:phone:" + phone;
    };

    //聊天记录存储用户发送到管理员接收的信息
    public static String TALK_USER_ADMIN_KEY(String userId, String adminId){
        return "talk:userId:" + userId + ":adminId:" + adminId;
    }

    //聊天记录存储管理员发送用户接收到的信息
    public static String TALK_ADMIN_USER_KEY(String userId, String adminId){
        return "talk:adminId:" + adminId + ":userId:" + userId;
    }

    //用户与管理员的聊天ID存储
    public static String TALK_USER_ADMIN_ID_KEY(String userId, String adminId){
        return "talk:userId:" + userId + ":adminId:" + adminId + ":id";
    }

    //管理员与用户的聊天ID存储
    public static String TALK_ADMIN_USER_ID_KEY(String userId, String adminId){
        return "talk:adminId:" + adminId + ":userId:" + userId + ":id";
    }

    //用户聊天对象列表
    public static String TALK_FORM_USER_KEY(String userId){
        return "talk:form:userId:" + userId;
    }

    //管理员聊天对象列表
    public static String TALK_FORM_ADMIN_KEY(String adminId){
        return "talk:form:adminId:" + adminId;
    }

    //存储用户未读消息
    public static String UNREAD_MESSAGE_COUNT_KEY(String userId, String adminId){
        return "unread:message:count:userId:" + userId + ":adminId:" + adminId;
    }

    //存储用户未读消息
    public static String UNREAD_MESSAGE_LIST_KEY(String userId, String adminId){
        return "unread:message:list:userId:" + userId + ":adminId:" + adminId;
    }

    public static String WASTE_TYPE_COUNT_KEY() {
        return "waste_type_search_count";
    }
    public static String WASTE_TYPE_KEY() {
        return "waste_type" ;
    }
}

